package com.verbetia.musictrends.web.music;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.verbetia.musictrends.persistence.hsqldb.MusicsPersMngr;
import com.verbetia.musictrends.persistence.hsqldb.Utils;

public class DeleteItem extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		String id = request.getParameter("iid");
		
		if (id!=null || !id.equals(""))
		{
			MusicsPersMngr music = new MusicsPersMngr();
			
			
	        try  			
	        {
	        	music.removeInstance(id);
	        	
			} catch (SQLException sqle)
	        {
	        	System.out.println(sqle);
	        }
	        
		}
		
		response.sendRedirect("home.jsp");
		
	}
}
